<style>
    .queren{float: right;width: 25%;text-align: center; border-radius: .5rem;font-size: .75rem; border: 1px solid #f50521;color:#f50521; }
    .commodity-state a {width:20%;text-align: center; background: #f50521;border-radius: .2rem;color: #FFF;    display: block;float: left}
    .xzfd{float: left; color: #555 !important;font-size: 1.2rem!important; margin-left: 0 !important;}
    .commodity-price{bottom: 1rem !important;}
    </style>
<div class="header">
    <a class="return iconfont icon-shangyiye" href="javascript:history.back(-1);"></a>
    <div class="header-title">我参与的</div>
</div>
<div class="content-bot">
    <?php if(!empty($output['order_list']) && is_array($output['order_list']) ){ ?>
        <?php  foreach($output['order_list'] as $k =>$v){ ?>

    <div class="group-order">
        <div class="go-title">发起者：<samp><?php echo $output['member_name']; ?></samp><span>时间：<?php  echo date('Y-m-d H:i:s',$v['add_time']); ?></span></div>
        <div class="commodity">
            <div>
                <div class="commodity-img">
                    <a href="index.php?act=bargain&op=bargain_info&bargain_id=<?php echo $v['bargain_id'];?>"><img src="<?php echo  getbargain_img($v['bg_thumb']); ?>" /></a>
                </div>
                <div class="commodity-con">
                    <div class="commodity-title"><a href="index.php?act=bargain&op=bargain_info&bargain_id=<?php echo $v['bargain_id'];?>"><?php echo $v['bg_title']; ?></a></div>
                    <?php if(!empty($v['add_ress_id'])) {?>
                    <div class="commodity-code">券码：<?php echo $v['bg_order_code']; ?></div>
                    <?php  }else{ ?>
                        <div class="commodity-code" style='font-size: 1rem;margin-top:0.5rem;'>订单号：<?php echo $v['bg_order_sn']; ?></div>
                <?php  }?>
                    <?php if($v['if_winners']==1) {?>
                    <img src="resource/images/u504.png" class="chapter" />
                <?php } ?>
                    <div class="commodity-price">
                       <?php if($v['bg_order_status']==20  || $v['bg_order_status']=='21'  || $v['bg_order_status'] == '40' || $v['bg_order_status'] == '41' ){?>
                        <a href="index.php?act=bargain_order&op=order_info&order_id=<?php echo $v['bg_order_id']; ?>" class="queren">查看详情</a>
                        <?php  } ?>
                        <div class="commodity-state"><span class="xzfd">状态：</span>

                            <?php if($v['bg_order_status']=='20'|| $v['bg_order_status']=='21' || $v['bg_order_status'] == '40' || $v['bg_order_status'] == '41') {?>
                                <a style="font-size: .8rem;text-align: center;background:#ffcc00;">已完成</a>
                           <?php } elseif($v['bg_order_status']!=='20' && $v['end_time']>time()) { ?>
                                <a style="font-size: .8rem;text-align: center;">进行中</a>
                            <?php  }else{?>
                                <samp style="font-size: 15px;">活动结束</samp>
                            <?php  }?>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    </div>
            <?php  }?>
<?php   }?>

</div>
<div style="height: 10px;"></div>
<script>
    var allNum = <?php echo $output['TotalNum']; ?>,
        allPage = <?php echo $output['TotalPage']; ?>,
        curPage = 1;

    var is_scroll = false;
    //ajax加载数据
    function loadpage() {
        if(!is_scroll){
            return;
        }
        if (curPage < allPage) {
            curPage += 1;
        } else {
            return;
        }
        $.get(location.href, {isajax:1,curpage:curPage},function(data){
            if(data){
                $(".content-bot").append(data);
            }
        });
    }

    $(window).scroll(function () {

        is_scroll = true;
        //已经滚动到上面的页面高度
        var scrollTop = $(this).scrollTop();
        //页面高度
        var scrollHeight = $(document).height();
        //浏览器窗口高度
        var windowHeight = $(this).height();
        //此处是滚动条到底部时候触发的事件，在这里写要加载的数据，或者是拉动滚动条的操作
        if (scrollTop + windowHeight == scrollHeight) {
            loadpage();
        }
    });

</script>